<?php
/**
 * Created by PhpStorm.
 * Author: Shadow
 * Date: 2022/5/21
 * Time: 9:54 上午
 * description: home.php
 */

use think\facade\Route;
Route::get('/',"Index/index");


/**
 * 用户登录注册相关
 */

Route::get('login','Login/login');
Route::get('logout','Login/logout');

# 为了做QQ登录
Route::get('/home/login/qqcallback',"Login/qq");
// 判断请求方式、 进行合并
Route::get('register','Login/register');
Route::post('doRegister','Login/doRegister');
Route::post('doLogin','Login/doLogin');

Route::post('sendCode','Login/sendCode');



/**
 * 商品有关
 */

Route::group(function (){
   Route::get('goodsList',"Goods/list");
   Route::get('detail',"Goods/detail");

});

/**
 * 购物车有关的
 */
Route::group(function(){
    Route::get('addCart',"Cart/addCart");
    Route::get('cart',"Cart/cart");
    Route::post('changeNumber',"Cart/changeNumber");
    Route::post('changeSelected',"Cart/changeSelected");
    Route::get('del',"Cart/del");
    Route::post('batchDel',"Cart/batchDel");
});

/**
 * 订单有关
 */
Route::group(function (){
   Route::get('getOrderInfo',"Order/getOrderInfo");
   Route::get('myOrder',"Order/myOrder");
});

Route::group(function (){
    Route::get('pay',"pay/pay");
    Route::post('payMoney',"pay/payMoney");
    Route::post('notify',"pay/syncNotice");//异步回调值
    Route::get('async',"pay/asyncNotice");//同步回调地址
});


/**
 * 优惠卷
 */
Route::group(function (){
   Route::get('/coupon',"coupon/list");
   Route::get('/receiveCoupon',"coupon/receive");// 领取优惠卷
});
